<!DOCTYPE html>
<html>
<head>
<title>组织机构</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=9, IE=10, chrome=1" />
<meta name="renderer" content="webkit" />
<link href="../framework/css/font.css" rel="stylesheet" />
<link href="../framework/miniui/themes/material/miniui.css" rel="stylesheet" />
<link href="../framework/css/app.min.1.css" rel="stylesheet" type="text/css" />
<link href="../framework/css/app.min.2.css" rel="stylesheet" type="text/css" />
<script src="../framework/main.js"></script>
<style type="text/css">
.input-group-addon{width:160px;text-align: right;}
</style>
<script type="text/javascript">
	Page.onLoad(function(){
		//console.info(getDom('Name'));
	});
	
	function onSelectManager() {
		var diag = mini.open({
			width: 900,
			height : 500,
			title : "选择主管",
			url : "${ctx}mhr/resourceList.jhtml?BranchInnerCode="+mini.get("BranchInnerCode").getValue(),
			onLoad : function(){
			},
			onOk : addSave
		});
	}
	
	function addSave() {
		var row = $DW.mini.get('dg1').getSelected();
		mini.get("Manager").setText(row.RealName);
		mini.get("Manager").setValue(row.Member);
		$D.close();
	}

</script>
</head>
<body class="dialog">
<ef:init method="MemberBranch.initDialog">
	<form id="form2">
		<input id="ID" class="mini-hidden" type="hidden" value="${ID}"  />
		<input id="BranchInnerCode" class="mini-hidden" type="hidden" value="${BranchInnerCode}"  />
		<div class="container-fluid">
			<div class="row">
				<div class="col-xs-12">
					<div class="input-group" style="margin-top:8px;">
						<span class="input-group-addon">上级机构</span>
						<input id="ParentInnerCode" class="mini-treeselect" method="MemberBranch.tree" textField="Name" style="width:200px" resultAsTree="false" idField="BranchInnerCode" parentField="ParentInnerCode" value="${ParentInnerCode}" valueField="BranchInnerCode"/>
					</div>
					<div class="input-group">
						<span class="input-group-addon">名称</span>
						<input id="Name" name="Name" class="mini-textbox" value="${Name}" required="true"/>
					</div>
					<div class="input-group">
						<span class="input-group-addon">编码</span>
						<input id="BranchCode" name="BranchCode" type="text" value="${BranchCode}" required="true" class="mini-textbox" style="width:200px"/>
					</div>
					<div class="input-group">
						<span class="input-group-addon">类型</span>
						<input class="mini-combobox" id="Type" style="width:200px" data='[{id:1,text:"厂区"},{id:2,text:"部门"},{id:3,text:"班组"}]' value="${Type}" required="true"/>   
					</div>
					<div class="input-group">
						<span class="input-group-addon">地理位置</span>
						<input id="Geo" name="Geo" type="text" value="${Geo}" class="mini-textbox" style="width:200px"/>
					</div>
					<div class="input-group">
						<span class="input-group-addon">机构主管</span>
						<input id="Manager" class="mini-buttonedit" onbuttonclick="onSelectManager" name="Manager" text="${ManagerName}" value="${Manager}"/>
					</div>
					<div class="input-group">
						<span class="input-group-addon">电话</span>
						<input id="Phone" type="text" value="${Phone}" class="mini-textbox" verify="Length<20" style="width:200px" />
					</div>
					<div class="input-group">
						<span class="input-group-addon">传真</span>
						<input id="Fax" name="Fax" type="text" value="${Fax}" class="mini-textbox" verify="Length<20" vtype="Tel" style="width:200px" />
					</div>
					
				</div>
			</div>
		</div>
	</form>
</ef:init>
</body>
</html>